package com.itheima;

import com.itheima.dao.BookDao;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

/**
 * @author Xiao
 * @date 2021/9/12
 */
public class App02 {
    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("aplicationContext.xml");
//        ApplicationContext ctx = new FileSystemXmlApplicationContext("D:\\develop\\IdeaProjects\\mySpring\\datasource\\src\\main\\resources\\aplicationContext.xml");
//        BookDao bookDao = (BookDao) ctx.getBean("bookDao");
        //BookDao bookDao = ctx.getBean("bookDao", BookDao.class);
        BookDao bookDao = ctx.getBean(BookDao.class);
        bookDao.save();
    }
}
